from django.db import models
from pubblr.app.product.models import Product


class FlexField(models.Model):
    name = models.CharField(max_length=100,unique=true)
    value_type = models.CharField(max_length=50)


    def __unicode__(self):
        return self.name + ":" + self.type


#todo: add onEdit predicate
class Data(models.Model):
    field_type = models.ForeignKey("FlexField.id", FlexField)
    product = models.ForeignKey("Product.id", Product)
    value = models.CharField(max_length=1000)


    def __unicode__(self):
        return self.value
        
        
class ProductInfo(Product):
    #proxy class
    pass